let arr = {
  token: 'token',
  name: 'name',
  isAdmin: 'isAdmin'
}
let obj = new Proxy({}, {
  get: function (_target, prokey) {
    let k = arr[prokey]
    return prokey in arr ? localStorage.getItem(k) : null
  },
  set: function (_target, propKey, value) {
    if (propKey in arr) {
      if (value === undefined) return true
      localStorage.setItem(arr[propKey], value)
      return true
    }
  }
})
export default obj;